package cn.liutao.dish.entity.vo;

import cn.liutao.common.enums.CommonEnum;
import cn.liutao.dish.entity.po.Cuisine;
import cn.liutao.dish.entity.po.Dish;
import cn.liutao.dish.entity.po.Taste;
import com.mybatisflex.annotation.*;
import lombok.Data;

import java.util.List;

/**
 * @author liutao
 * @Description 菜品vo类
 * @date 2023/11/1 9:20
 * @Version 1.0
 */
@Data
public class DishVo extends Dish {
    @RelationManyToMany(
            selfField = "id",
            targetField = "id",
            targetTable = "taste",
            joinTable = "dish_taste_relation",
            joinSelfColumn = "dish_id",
            joinTargetColumn = "taste_id",
            extraCondition = ("status= :status")
    )
    private List<Taste> itemList;

    @RelationManyToOne(selfField = "cuisineId",targetField = "id",targetTable = "cuisine")
    private Cuisine cuisine;
}
